<template>
  <ez-button :plain="true" @click="open1">message</ez-button>
  <ez-button :plain="true" @click="open2">success</ez-button>
  <ez-button :plain="true" @click="open3">warning</ez-button>
  <ez-button :plain="true" @click="open4">error</ez-button>
</template>

<script lang="ts" setup>
  import { EzMessageFn } from '../../../packages/components'

  const open1 = () => {
    EzMessageFn({
      showClose: true,
      message: 'This is a message.'
    })
  }
  const open2 = () => {
    EzMessageFn({
      showClose: true,
      message: 'Congrats, this is a success message.',
      type: 'success'
    })
  }
  const open3 = () => {
    EzMessageFn({
      showClose: true,
      message: 'Warning, this is a warning message.',
      type: 'warning'
    })
  }
  const open4 = () => {
    EzMessageFn({
      showClose: true,
      message: 'Oops, this is a error message.',
      type: 'danger',
      duration: 0
    })
  }
</script>
